﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;

namespace HigLabo.Net.Twitter
{
    public partial class TwitterClient
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="woeID"></param>
        /// <param name="callback"></param>
        public void GetTrendsPlace(Int32 woeID, Action<TrendsCollection> callback)
        {
            GetTrendsPlaceCommand command = new GetTrendsPlaceCommand();
            command.WoeID = woeID;
            this.GetTrendsPlace(command, callback);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="command"></param>
        /// <param name="callback"></param>
        public void GetTrendsPlace(GetTrendsPlaceCommand command, Action<TrendsCollection> callback)
        {
            this.GetResultText(TwitterApiUrl.Version1_1.LocalTrends.GetTrendsPlaceUrl, command, json => callback(new TrendsCollection(json)));
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="latitude"></param>
        /// <param name="longitude"></param>
        /// <param name="callback"></param>
        public void GetTrendsClosest(Double latitude, Double longitude, Action<TrendLocationCollection> callback)
        {
            GetTrendsClosestCommand command = new GetTrendsClosestCommand() { Latitude = latitude, Longitude = longitude };
            this.GetTrendsClosest(command, callback);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="command"></param>
        /// <param name="callback"></param>
        public void GetTrendsClosest(GetTrendsClosestCommand command, Action<TrendLocationCollection> callback)
        {
            this.GetResultText(TwitterApiUrl.Version1_1.LocalTrends.GetTrendsClosestUrl, command, json => callback(new TrendLocationCollection(json)));
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="callback"></param>
        public void GetTrendsAvailable(Action<TrendLocationCollection> callback)
        {
            this.GetResultText(HttpMethodName.Get, TwitterApiUrl.Version1_1.LocalTrends.GetTrendsAvailableUrl, json => callback(new TrendLocationCollection(json)));
        }
    }
}
